home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_signs.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  125 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_signs.cog
  4. #
  5. # Indy reads up on Meroe
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. symbols
  13. message    startup
  14. message    entered
  15. message    exited
  16. message    activated
  17.  
  18. # world things
  19. thing    sign
  20. thing    player        local
  21.  
  22. # camera stuff
  23. thing    readcam
  24. thing    cam1spot    local
  25. thing    cam1look    local
  26.  
  27. # surfaces
  28. surface    readsign
  29.  
  30. # saylines
  31. sound    fairytale=pr04j03.wav    local
  32. sound    fabulous=pr04j04.wav    local
  33. sound    mines=Pr04j04b.wav        local
  34.  
  35. int        oktoread=0    local
  36. end
  37.  
  38.  
  39. code
  40. startup:
  41.     sleep(.01);
  42.     player = GetLocalPlayerThing();
  43.     
  44.     # global7 represents the number of sign readings have taken place
  45.     global7 = 1;
  46.     
  47.     return;
  48.  
  49. entered:
  50.     if (GetSenderRef() != readsign) return;
  51.  
  52.     oktoread = 1;
  53.     return;
  54.  
  55. exited:
  56.     if (GetSenderRef() != readsign) return;
  57.  
  58.     oktoread = 0;
  59.     return;
  60.     
  61.     
  62. activated:
  63.     if (GetSenderRef() != sign) return;
  64.     if (oktoread == 0) return;
  65.  
  66.     # prepare player
  67.     if (MakeMeStop() == -1) return;
  68.     DeselectWeaponWait(player);
  69.     
  70.     StartCutscene(1);
  71.     
  72.     # setup offset camera
  73.     cam1spot = CreateThing(GetThingTemplate(readcam), readcam);
  74.     cam1look = CreateThing(GetThingTemplate(readcam), readcam);
  75.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  76.     SetCameraLookInterp(2, 0);
  77.     SetCameraPosInterp(2, 0);
  78.     SetCameraFocus(2, cam1spot);
  79.     SetCameraSecondaryFocus(2, cam1look);
  80.     SetCurrentCamera(2);
  81.     ResetCameraFOV(0, 0.0);
  82.     SetCameraLookInterp(2, 1);
  83.     SetCameraPosInterp(2, 1);
  84.     SetCameraInterpSpeed(2, 0.7);
  85.     Sleep(0.01);
  86.     SetCameraFocus(2, readcam);
  87.     SetCameraSecondaryFocus(2, sign);
  88.     
  89.     # perform lines
  90.     sleep(.5);
  91.     if (global7 == 1)
  92.     {
  93.         PlayVoice(player, fairytale, 1, 1);
  94.         global7 = 2;
  95.     }
  96.     else if (global7 == 2)
  97.     {
  98.         PlayVoice(player, fabulous, 1, 1);
  99.         global7 = 3;
  100.     }
  101.     else if (global7 == 3)
  102.     {
  103.         PlayVoice(player, mines, 1, 1);
  104.     }
  105.     
  106.     Sleep(.5);
  107.  
  108.     # restore camera and get rid of objects
  109.     SetCameraLookInterp(2, 0);
  110.     SetCameraPosInterp(2, 0);
  111.     SetCameraPosition(1, GetThingPos(readcam));
  112.     SetCurrentCamera(1);
  113.     ResetCameraFOV(0, 0.0);
  114.     DestroyThing(cam1spot);
  115.     DestroyThing(cam1look);
  116.     
  117.     #restore player, end scene
  118.     sleep(.5);
  119.     EndCutscene();
  120.     ClearActorFlags(player, 0x200000);
  121.     
  122.     return;
  123.  
  124. end
  125.